In view of the problems that the upsampling process of U-Net is easy to lose details, and the datasets of stomach cancer pathological image are generally small, which tends to lead to over-fitting, an automatic segmentation model for pathological images of stomach cancer based on improved U-Net was proposed, namely EOU-Net. In EOU-Net, based on the existing U-Net model, EfficientNetV2 was used as the backbone, thereby enhancing the feature extraction ability of the network encoder. In the decoding stage, the relations between cell pixels were explored on the basis of Object-Contextual Representation (OCR), and the improved OCR module was used to solve the loss problem of the upsampled image details. Then, the post-processing of Test Time Augmentation (TTA) was used to predict the images obtained by rollover and rotations at different angles of the input image respectively, and then the prediction results of these images were combined by feature fusion to further optimize the output results of the network, thereby solving the problem of small medical datasets effectively. Experimental results on datasets SEED, BOT and PASCAL VOC 2012 show that the Mean Intersection over Union (MIoU) of EOU-Net is improved by 1.8, 0.6 and 4.5 percentage points respectively compared with that of OCRNet. It can be seen that EOU-Net can obtain more accurate segmentation results of stomach cancer images.